package com.example.myappapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.Toast;

import com.avatr.commonapi.vehicle.constant.VehicleZone.WindowZone;
import com.avatr.commonapi.vehicle.constant.VehicleZone.DoorZone;
import com.avatr.commonapi.vehicle.vehicle.planb.map.DoorAndTrunkStateEnum;

import com.avatr.commonapi.vehicle.DoorManagerApiImpl;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Switch s = findViewById(R.id.switch1);
        s.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                DoorManagerApiImpl doorManagerApi = new DoorManagerApiImpl();

                if(s.isChecked()){
                    Toast.makeText(MainActivity.this,"开启",Toast.LENGTH_LONG).show();
                    System.out.println("开启 111111111111111111111111999999999999999999999999");

                    doorManagerApi.setDoorOpenStatus(DoorZone.REAR,DoorAndTrunkStateEnum.DOOR_POS_FULL_OPEN);
                }else {
                    Toast.makeText(MainActivity.this,"关闭",Toast.LENGTH_LONG).show();
                    System.out.println("关闭 8888888888888888888888888888888888888");
                    doorManagerApi.setDoorOpenStatus(DoorZone.REAR,DoorAndTrunkStateEnum.DOOR_POS_FULL_CLOSE);
                }
            }
        });

        System.out.println("111111111111111111111"+WindowZone.ROW1_LEFT+"000000000000000000000");
    }
}